package dq.study.designmodel.state;

/**
 * @author dongqun
 * @Description:
 * @date 2019/4/19 23:24
 */
public class Context {
    private State state;

    public Context(State state) {
        this.state = state;
    }

    public void method() {
        if (state.getValue().equals("state1")) {
            state.method();
        } else if (state.getValue().equals("state2")) {
            state.method();
        }
    }
}
